<template></template>

<script>
import cloudbase from "@cloudbase/js-sdk";
export default {
  name: "Database",
  data() {
    return{
      data_db,
    }
  },
  methods: {
    async init() {
      const app = cloudbase.init({
        env: "huatie-cloud-7gitb0lvf130784c",
      });
      let promise = app
        .auth()
        .signInWithEmailAndPassword("382600375@qq.com", "SHUANG520");
      let result = await promise;
      this.dbState(result, app);
      return this.data_db;
    },
    dbState(loginState, app) {
      console.log("数据库登录成功");
      this.data_db = app.database();
    },
    Getdb() {
      return this.data_db
    }
  },
};
</script>